package cn.itsource.ymcc.openfeign.fallback;

import cn.itsource.ymcc.common.result.JsonResult;
import cn.itsource.ymcc.openfeign.OrderFeignClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OrderFeignClientFallbackFactory implements FallbackFactory<OrderFeignClient> {
    @Override
    public OrderFeignClient create(Throwable throwable) {
        return new OrderFeignClient() {
            @Override
            public JsonResult getUserIdAndCourseId(String orderNo) {
                return JsonResult.error("getUserIdAndCourseId调用失败");
            }
        };
    }
}
